feat(backend): add structured audit logging for admin and auth actions - #938
feat(backend): add structured audit logging for admin and auth actions#938Banx17 wants to merge 1 commit into
Conversation
Emit audit entries with actor, action, params, and requestId for auth success, admin access grant/deny, and successful indexer reset/replay. Keeps logs free of secrets/tokens. Co-authored-by: Cursor <cursoragent@cursor.com>
|
heads up: main's ci was broken (the Backend CI and Backend Docker Image CI jobs) until the fixes in #969 and #974 just landed, so the red backend/docker checks on this pr are almost certainly stale, they ran against the broken main. please rebase to re-test against the now-green main: |
|
the structured audit logging looks clean (and it omits secrets, good). the red is infra noise, the Docker CI 'could not find prisma schema' plus a frontend parse error in create/page.tsx which your pr doesn't touch (fixed by #943). stale base, rebase: |
ogazboiz
left a comment
There was a problem hiding this comment.
still a clean design: auditLog on top of the existing requestContext, no secrets logged, sensible hook points, as noted back in july. to land it:
- rebase onto current main, auth.ts and admin.routes.ts have changed since (branch is conflicting).
- optional: a small unit test asserting auditLog emits actor and action and omits tokens.
if there is no movement within a week we will close it and fold the idea into a fresh issue, since it has been a month since the last review.
if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0
Closes #824